/**
 * @license
*
* PreProcessing is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PreProcessing is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PreProcessing.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
package SmartGrid;

import java.sql.*;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSetMetaData;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.derby.jdbc.ClientDriver;

/**
 *
 * @author Grant 
 */
public class SmartGridGUI extends javax.swing.JFrame {

    // jdbc Connection
    private static Connection conn = null;
    private static Statement stmt = null;
    
    private int deviceCount=0;
    private int acCount=0;
    private int evCount=0;
    private int logCount=1;
    
    /**
     * create global meter object
     * 
     */
    protected Meter meter = new Meter();
    ConsumerDevice cd1 = new ConsumerDevice();
    ReverseCycleAC ac = new ReverseCycleAC();
    ElectricalVehicle ev = new ElectricalVehicle();
        
    /**
     * Creates new form SmartGridGUI
     */
    public SmartGridGUI() {
        initComponents();
    }     
        
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblTitle = new javax.swing.JLabel();
        btnAddDevice = new javax.swing.JButton();
        lblMeterOutput = new javax.swing.JLabel();
        btnAddAC = new javax.swing.JButton();
        btnAddVehicle = new javax.swing.JButton();
        btnPeakLevel = new javax.swing.JButton();
        btnOverload = new javax.swing.JButton();
        btnExit = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtMeterOutput = new javax.swing.JTextArea();
        lblConnect = new javax.swing.JLabel();
        btnDisconnectDevice = new javax.swing.JButton();
        btnDiscAC = new javax.swing.JButton();
        btnDisVeh = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Smart Grid 2012");
        setBackground(new java.awt.Color(153, 204, 255));
        setBounds(new java.awt.Rectangle(150, 100, 800, 400));
        setForeground(java.awt.Color.white);

        lblTitle.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lblTitle.setText("Smart Grid Monitoring System Ver 1.0.0");

        btnAddDevice.setText("Add Device");
        btnAddDevice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddDeviceActionPerformed(evt);
            }
        });

        lblMeterOutput.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        lblMeterOutput.setText("Meter");
        lblMeterOutput.setToolTipText("This displays the Meter interactions with the system");

        btnAddAC.setText("Add Air Con");
        btnAddAC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddACActionPerformed(evt);
            }
        });

        btnAddVehicle.setText("Add Vehicle");
        btnAddVehicle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddVehicleActionPerformed(evt);
            }
        });

        btnPeakLevel.setText("Peak Leveling");
        btnPeakLevel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPeakLevelActionPerformed(evt);
            }
        });

        btnOverload.setText("Over Load Meter");
        btnOverload.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOverloadActionPerformed(evt);
            }
        });

        btnExit.setText("Exit");
        btnExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExitActionPerformed(evt);
            }
        });

        txtMeterOutput.setColumns(20);
        txtMeterOutput.setRows(5);
        jScrollPane1.setViewportView(txtMeterOutput);

        lblConnect.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lblConnect.setText("Connections");

        btnDisconnectDevice.setText("Disconnect");
        btnDisconnectDevice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDisconnectDeviceActionPerformed(evt);
            }
        });

        btnDiscAC.setText("Disconnect");
        btnDiscAC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDiscACActionPerformed(evt);
            }
        });

        btnDisVeh.setText("Disconnect");
        btnDisVeh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDisVehActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(178, 178, 178)
                .addComponent(lblTitle)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(btnOverload)
                                .addGap(41, 41, 41)
                                .addComponent(btnPeakLevel, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(58, 58, 58)
                                .addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jScrollPane1))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(btnAddAC, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
                            .addComponent(btnAddDevice, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnAddVehicle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(lblMeterOutput, javax.swing.GroupLayout.DEFAULT_SIZE, 494, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblConnect)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnDisconnectDevice)
                    .addComponent(btnDiscAC)
                    .addComponent(btnDisVeh))
                .addGap(44, 44, 44))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(lblTitle)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addComponent(lblConnect))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblMeterOutput)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnAddDevice)
                            .addComponent(btnDisconnectDevice))
                        .addGap(4, 4, 4)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnAddAC)
                            .addComponent(btnDiscAC))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnAddVehicle)
                            .addComponent(btnDisVeh)))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnPeakLevel)
                    .addComponent(btnOverload)
                    .addComponent(btnExit))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        lblTitle.getAccessibleContext().setAccessibleName("lblTitle");
        btnAddDevice.getAccessibleContext().setAccessibleName("btnAddDevice");
        lblMeterOutput.getAccessibleContext().setAccessibleName("lblMeterOutput");
        btnExit.getAccessibleContext().setAccessibleName("btnExit");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAddDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddDeviceActionPerformed
        if (deviceCount < 1){
            //create device and add it to the meter        
            
            cd1.setDeviceName("testDevice");
            cd1.setDeviceID(deviceCount);
            cd1.setPowerConsumed(8.35);
            txtMeterOutput.append("\nAdding device " + cd1.getDeviceName() + "Power Consumption per block " + cd1.getPowerConsumed()) ;
            meter.addDevice(deviceCount);
            deviceCount++;
            //create log
            Log log = new Log(cd1.getDeviceID());
            System.out.println(log.getLogStartDateTime());
            //add log to database
            try {
                createConnection();
                Statement sta = conn.createStatement();
                sta.executeUpdate("INSERT INTO APP.\"log\" (\"logID\", \"logStartDateTime\", \"logEndDateTime\", \"meterID\", \"powerConsumed\", \"tariffID\", \"DEVICEID\")"
                + " VALUES (1, '"+log.getLogStartDateTime() + "', "+null+", 1, "+null+", 1, "+log.getLogDeviceID()+")");
                logCount++;
                System.out.println("Log file created");
                txtMeterOutput.append("\nLog file created for " + cd1.getDeviceName() + " Created : " + log.getLogStartDateTime());
                shutdown();
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
            
        }
    }//GEN-LAST:event_btnAddDeviceActionPerformed
    
    private void btnAddACActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddACActionPerformed
        
        ac.setDeviceName("Air Con");
        ac.setPowerConsumed(24.23);        
        txtMeterOutput.append("\nAdding device " + ac.getDeviceName() + "Power Consumption per block " + ac.getPowerConsumed());
        
        meter.addDevice(deviceCount);
            deviceCount++;
            //create log
            Log log = new Log(ac.getDeviceID());
            System.out.println(log.getLogStartDateTime());
            //add log to database
            try {
                createConnection();
                Statement sta = conn.createStatement();
                sta.executeUpdate("INSERT INTO APP.\"log\" (\"logID\", \"logStartDateTime\", \"logEndDateTime\", \"meterID\", \"powerConsumed\", \"tariffID\", \"DEVICEID\")"
                + " VALUES (2, '"+log.getLogStartDateTime() + "', "+null+", 1, "+null+", 1, "+log.getLogDeviceID()+")");
                logCount++;
                System.out.println("Log file created");
                txtMeterOutput.append("\nLog file created for " + ac.getDeviceName() + " Created : " + log.getLogStartDateTime());
                shutdown();
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
    }//GEN-LAST:event_btnAddACActionPerformed

    private void btnAddVehicleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddVehicleActionPerformed
        
        ev.setDeviceName("Electrical Vehicle");
        ev.setElcVehConnectedToLAN(true);
        ev.setElcVehPowerStored(800);
        ev.setElcVehStatus("charge");
        ev.setPowerConsumed(12.54);
        txtMeterOutput.append("\nAdding device " + ev.getDeviceName() + " Power Consumption per block " + ev.getPowerConsumed()
                + " Status : charge");
        meter.addDevice(deviceCount);
            deviceCount++;
            //create log
            Log log = new Log(ev.getDeviceID());
            System.out.println(log.getLogStartDateTime());
            //add log to database
            try {
                createConnection();
                Statement sta = conn.createStatement();
                sta.executeUpdate("INSERT INTO APP.\"log\" (\"logID\", \"logStartDateTime\", \"logEndDateTime\", \"meterID\", \"powerConsumed\", \"tariffID\", \"DEVICEID\")"
                + " VALUES (3, '"+log.getLogStartDateTime() + "', "+null+", 1, "+null+", 1, "+log.getLogDeviceID()+")");
                logCount++;
                System.out.println("Log file created");
                txtMeterOutput.append("\nLog file created for " + ev.getDeviceName() + " Created : " + log.getLogStartDateTime());
                shutdown();
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
    }//GEN-LAST:event_btnAddVehicleActionPerformed

    private void btnPeakLevelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPeakLevelActionPerformed
        txtMeterOutput.append("\nPeak Leveling to be done ");
    }//GEN-LAST:event_btnPeakLevelActionPerformed

    private void btnOverloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOverloadActionPerformed
        txtMeterOutput.append("\nOver Loading the meter to be done ");
    }//GEN-LAST:event_btnOverloadActionPerformed

    private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
        JDialog.setDefaultLookAndFeelDecorated(true);
        int response = JOptionPane.showConfirmDialog(null, "Do you want to exit?", "Confirm",
        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (response == JOptionPane.NO_OPTION) {
        //System.out.println("No button clicked");
        } else if (response == JOptionPane.YES_OPTION) {
        //System.out.println("Yes button clicked");
        System.exit(0);
        } else if (response == JOptionPane.CLOSED_OPTION) {
        //System.out.println("JOptionPane closed");
        }
    }//GEN-LAST:event_btnExitActionPerformed

    private void btnDiscACActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDiscACActionPerformed
        // disconnect the Air Con from the meter
        String date="";
        try {
                createConnection();
                Log lg = new Log();
                Statement sta = conn.createStatement();
                ResultSet result = sta.executeQuery("select APP.\"log\".\"logStartDateTime\" from APP.\"log\" where APP.\"log\".\"logID\"=2");
                String sdate = ""; 
                while (result.next())
                {sdate = result.getString(1);}
                date = lg.getDateTime();
                //System.out.println(date);
                Timestamp endDate = java.sql.Timestamp.valueOf(date);
                Timestamp startDate = java.sql.Timestamp.valueOf(sdate) ;
                long tdiff = endDate.getTime() - startDate.getTime();
                double total = (double)tdiff * 16.0;
                
                //System.out.println(date);
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"logEndDateTime\"='"+date+"' WHERE APP.\"log\".\"logID\"=2");
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"powerConsumed\"="+total+" WHERE APP.\"log\".\"logID\"=2");
                
                System.out.println("Log file Updated");
                shutdown();
                
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
        txtMeterOutput.append("\nLog file Updated. EndDateTime : " + date
                        +"\nDevice disconnected ");
    }//GEN-LAST:event_btnDiscACActionPerformed

    private void btnDisconnectDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDisconnectDeviceActionPerformed
        // disconnect the testDevice from the meter
        String date="";
        try {
            createConnection();
                Log lg = new Log();
                Statement sta = conn.createStatement();
                ResultSet result = sta.executeQuery("select APP.\"log\".\"logStartDateTime\" from APP.\"log\" where APP.\"log\".\"logID\"=1");
                String sdate = ""; 
                while (result.next())
                {sdate = result.getString(1);}
                date = lg.getDateTime();
                //System.out.println(date);
                Timestamp endDate = java.sql.Timestamp.valueOf(date);
                Timestamp startDate = java.sql.Timestamp.valueOf(sdate) ;
                long tdiff = endDate.getTime() - startDate.getTime();
                double total = (double)tdiff * 16.0;
                             
                
                //System.out.println(date);
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"logEndDateTime\"='"+date+"' WHERE APP.\"log\".\"logID\"=1");
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"powerConsumed\"="+total+" WHERE APP.\"log\".\"logID\"=1");
                
                System.out.println("Log file Updated");
                shutdown();
                
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
        txtMeterOutput.append("\nLog file Updated. EndDateTime : " + date
                        +"\nDevice disconnected ");
    }//GEN-LAST:event_btnDisconnectDeviceActionPerformed

    private void btnDisVehActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDisVehActionPerformed
        // disconnect the Electric Vehicle from the meter
        String date="";
        try {
                createConnection();
                Log lg = new Log();
                Statement sta = conn.createStatement();
                ResultSet result = sta.executeQuery("select APP.\"log\".\"logStartDateTime\" from APP.\"log\" where APP.\"log\".\"logID\"=3");
                String sdate = ""; 
                while (result.next())
                {sdate = result.getString(1);}
                date = lg.getDateTime();
                //System.out.println(date);
                Timestamp endDate = java.sql.Timestamp.valueOf(date);
                Timestamp startDate = java.sql.Timestamp.valueOf(sdate) ;
                long tdiff = endDate.getTime() - startDate.getTime();
                double total = (double)tdiff * 16.0;
                
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"logEndDateTime\"='"+date+"' WHERE APP.\"log\".\"logID\"=3");
                sta.executeUpdate("update APP.\"log\" set APP.\"log\".\"powerConsumed\"="+total+" WHERE APP.\"log\".\"logID\"=3");
                
                System.out.println("Log file Updated");
                shutdown();
                
            } catch (SQLException ex) {
                Logger.getLogger(SmartGridGUI.class.getName()).log(Level.SEVERE, null, ex);
                System.err.println("Exception: "+ex.getMessage());
            }
        txtMeterOutput.append("\nLog file Updated. EndDateTime : " + date
                        +"\nDevice disconnected ");
    }//GEN-LAST:event_btnDisVehActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) throws Exception {
        
        //ServerFrame.class.txtServerOutput.append("\nAdding Meter " + meter.getMeterID());
           
        
        try {
            //connect to the database
            createConnection();

            Statement sta = conn.createStatement(); 

        // insert 1 row into the device testing
            /*sta.executeUpdate("INSERT INTO APP.\"device\" (\"deviceID\", \"deviceName\", \"deviceDescription\", \"powerConsumption\", \"endPointConnectable\")"
                + " VALUES (5, 'testDevice45', 'this is the test device 5', 16.60, 0)");

            ResultSet result = sta.executeQuery("select * from APP.'device'");
            while(result.next()){
                System.out.println(result.getString(1)+" "+result.getString(2));
            }*/

            ResultSet result = sta.executeQuery("select * from APP.\"device\"");
        
            while(result.next()){
                System.out.println(result.getString(1)+" "+result.getString(2));
            }
            //disconnect from the database and close any active statements
            shutdown();            
        }
                
        catch (Exception e) {
            System.err.println("Exception: "+e.getMessage());
        }
        
        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new SmartGridGUI().setVisible(true);
                new ServerFrame().setVisible(true);
            }
        });
        
        
    }
    
    /**
     * @brief the database connection will be established
     */
    private static void createConnection()
    {
        try
        {
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            
            conn = DriverManager.getConnection("jdbc:derby://localhost/Smartgrid", "root"," "); 
        }
        catch (Exception except)
        {
            except.printStackTrace();
        }
    }
    /**
     * @brief the database and any active connections will be closed
     */
    private static void shutdown()
    {
        try
        {
            if (stmt != null)
            {
                stmt.close();
            }
            if (conn != null)
            {
                DriverManager.getConnection("jdbc:derby://localhost/Smartgrid", "root"," " + ";shutdown=true");
                conn.close();
            }           
        }
        catch (SQLException sqlExcept)
        {
            sqlExcept.printStackTrace();
        }

    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddAC;
    private javax.swing.JButton btnAddDevice;
    private javax.swing.JButton btnAddVehicle;
    private javax.swing.JButton btnDisVeh;
    private javax.swing.JButton btnDiscAC;
    private javax.swing.JButton btnDisconnectDevice;
    private javax.swing.JButton btnExit;
    private javax.swing.JButton btnOverload;
    private javax.swing.JButton btnPeakLevel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblConnect;
    private javax.swing.JLabel lblMeterOutput;
    private javax.swing.JLabel lblTitle;
    private javax.swing.JTextArea txtMeterOutput;
    // End of variables declaration//GEN-END:variables
}
